package com.surprise.db.datasources;

import java.util.Map;

import javax.sql.DataSource;

import lombok.Data;

/**
 *
 * @author nick
 * 2013-11-14
 */
@Data
public class DataSourceWrapper {
    public Map<String, DataSource> dataSources;

    public DataSource getDataSourcesByName(String dataSourceName) {
        if (dataSources.containsKey(dataSourceName)) {
            return dataSources.get(dataSourceName);
        } else {
            throw new RuntimeException(dataSourceName + " not exists");
        }
    }
}
